package edu.nf.controller.region;

import edu.nf.hotel.region.CityType;
import edu.nf.hotel.region.CityTypeService;
import edu.nf.hotel.region.impl.CityTypeServiceImpl;
import edu.nf.hotel.vo.PageVO;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

import java.util.List;

/**
 * @Date 2023-06-20
 * @Author 带土
 */
public class CityTypeController{

    @RequestMapping("/cityType/list")
    public View listCity(@RequestParam("page") int page,
                         @RequestParam("limit") int limit){
        CityTypeService service = new CityTypeServiceImpl();
        PageVO<List<CityType>> pageVO = service.listCity(page, limit);
        //创建JSON视图响应
        return new JsonView(pageVO);
    }
}
